import { Button } from 'antd';
import React, { PureComponent } from 'react';
import UseStateRightChild from './UseStateRightChild';

class UseStateRight extends PureComponent {

    state = {
        count: 0
    }

    render() {
        return (
            <div>
                <Button type='primary' onClick={() => this.setState({ count: this.state.count + 1 })}>点击按钮更新子组件props值</Button>
                <br /><br />
                <UseStateRightChild count={this.state.count} />
            </div>
        )
    }
};

export default UseStateRight;